-
Notifications
You must be signed in to change notification settings - Fork 3.2k
HTML API: Set $this->html to protected to support subclassing.
#4112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When the HTML API was introduced a number of fields were switched from `private` visibility to `protected` so that Gutenberg and other systems could more easily enhance the behaviors through subclassing. The `$this->html` property was overlooked but important for systems using the Tag Processor to stich HTML, specifically performing operations on `innerHTML` and `innerText`. This patch updates that visibility to what it should have been during the introducing of the API in 39bfc25.
62c3014 to
db398cb
Compare
|
@azaozz I included you here because I'd like to try and get this into 6.2 still. Should I create a Trac ticket for it? |
|
We can reuse https://core.trac.wordpress.org/ticket/57575. See a similar follow-up in https://core.trac.wordpress.org/changeset/55206. I'll take care of it. |
|
Committed with https://core.trac.wordpress.org/changeset/55402. |
|
Just noting I'm running into access issues now in my HTML parsing PR and it would be handy to have a few more properties marked as |
|
@adamziel
|
|
Oh! Hm, perhaps I am. Thanks! |
Uh, sorry for the late response, seeing this just now :( Yes, as the HTML API is already in core, any bugfixes or "code cleanup" can be added during beta. Bugfixes can also be added during RC but it is usually reserved for "bigger" bugs and edge cases, for example if there's a fatal error in some circumstances, etc. For small changes like this one there's usually no need for a new ticket. New trac tickets are good for larger bugfixes, and for bugs that are fixed during RC. Documentation (docblock) and tests can be added at any time and usually it is a good idea to have new tickets for them especially if the changes are more substantial. |
In the 6.2 compat layer, make `WP_HTML_Tag_Processor`'s `$html` member `protected` to support subclassing. This is for parity with Code in WordPress 6.2, see WordPress/wordpress-develop#4112 and [r55402](https://core.trac.wordpress.org/changeset/55402).
In the 6.2 compat layer, make `WP_HTML_Tag_Processor`'s `$html` member `protected` to support subclassing. This is for parity with Code in WordPress 6.2, see WordPress/wordpress-develop#4112 and [r55402](https://core.trac.wordpress.org/changeset/55402).
When the HTML API was introduced a number of fields were switched from
privatevisibility toprotectedso that Gutenberg and other systems could more easily enhance the behaviors through subclassing. The$this->htmlproperty was overlooked but important for systems using the Tag Processor to stich HTML, specifically performing operations oninnerHTMLandinnerText.This patch updates that visibility to what it should have been during the introducing of the API in 39bfc25.
Trac ticket: https://core.trac.wordpress.org/ticket/57575.
cc: @adamziel @ockham @azaozz